/* This file is just here so that you try what the SymCe can do.*/
#include <iostream>
#include <string>
#include "Expression.h"
using namespace std;
using namespace SymCe;
int main(){
	//Creating fractions - use Number() instead of Fraction
	/*Fraction a(NEGATIVE, 9,16);
	Fraction b(POSITIVE, 4,12);
	Expression e(a);
	Expression f(5);
	Expression g(b);
	Expression h, i, j, k;
	h = e+f;
	i = g-f;
	Expression e1("abc");
	j=tan(h)+cos(i);
	k = j-i+h;
	cout << k;*/
	//Create Expression - expression class stores the whole arithmetic expression as a tree.
	//Expresion four(4);
	Expression x("x");
	Expression a("a");
	Expression b("b");
	Expression c("c");
	Expression d("d");
	Expression e("e");
	Expression f("f");
	//Expression cosx = cos(x);
	//Expression sinx = sin(x);
	//Expression hard = ((cosx*sinx)^4)/((sinx*cosx)^2);
	//Expression soft = hard.reduce();
	//std::cout << soft;
	//Expression x2 = tan(x)+sin(x)+x+3;
	//You can manipulate expressions in usual way:
	Expression x2 = cos(x);
	std::cout << x2;
	std::cout << std::endl;
	//You can find derivatives
	std::cout << x2.diff("x").reduce() << std::endl; //Differentiate by variable "x"
	//std::cout << (tan(x)+sin(x)).diff(x) << std::endl; //Differentiate by variable x stored in Expression x.
	std::cout << ((a+b)/x*(c-d)/(e-f)).expand() << std::endl;
	std::cout << ((a*Number(0))-(b*Number(0))+(c)) << std::endl;
	std::cout << Expression((a+b)^Expression(-3)).expand() << std::endl;
	std::cout << x-x << std::endl;
	std::cout << ln(x).diff(x) << std::endl;
	std::cout << x+x << std::endl;
	std::cout << Expression(0)*x << std::endl;
	std::cout << (x^2)+x*x-x-Expression(2)*x+x*x-Expression(3)*(x^Expression(2))+Expression(3)*x << std::endl;

	//std::cout << Expression((x+Expression(1))^Expression(3)).expand() << std::endl;
	//std::cout << ((a+b+c)^7).expand() << std::endl;
	std::cout << x2.taylor(0, 10, "x") << std::endl;
	Expression pi("pi", 3.1415926535);
	std::cout << (x^3.5);
	std::cout << pi;

	return 0;
}
